package com.yh.csx.event.store.gateway.subscribe.dataobject;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * @author zhangsheng
 * @date 2021/8/11 14:55
 */
@Entity
@Table(name = "consumer_config" )
public class ConsumerConfigDo {
    private Long id;
    private Long projectId;
    private String topic;
    private String topicName;
    private String appName;
    private String consumeName;
    private String retryModel;
    private String remark;
    private Integer delFlag;
    private Integer status;
    private String creator;
    private String updater;
    private Date createTime;
    private Date updateTime;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "project_id", nullable = false)
    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    @Basic
    @Column(name = "topic", nullable = false, length = 100)
    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    @Basic
    @Column(name = "topic_name", nullable = false, length = 100)
    public String getTopicName() {
        return topicName;
    }

    public void setTopicName(String topicName) {
        this.topicName = topicName;
    }

    @Basic
    @Column(name = "app_name", nullable = false, length = 100)
    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    @Basic
    @Column(name = "consume_name", nullable = false, length = 100)
    public String getConsumeName() {
        return consumeName;
    }

    public void setConsumeName(String consumeModel) {
        this.consumeName = consumeModel;
    }

    @Basic
    @Column(name = "retry_model", nullable = false, length = 100)
    public String getRetryModel() {
        return retryModel;
    }

    public void setRetryModel(String retryModel) {
        this.retryModel = retryModel;
    }

    @Basic
    @Column(name = "remark", nullable = false, length = 500)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "del_flag", nullable = true)
    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "creator", nullable = false, length = 100)
    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    @Basic
    @Column(name = "updater", nullable = false, length = 100)
    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    @Basic
    @Column(name = "create_time", nullable = false)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = false)
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ConsumerConfigDo that = (ConsumerConfigDo) o;
        return Objects.equals(topic, that.topic) &&
                Objects.equals(consumeName, that.consumeName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(topic, consumeName);
    }
}
